{template '_header'}
<script type="text/javascript" src="../addons/mx_shop/static/js/dist/date/WdatePicker.js"></script>

<div class="page-header">
    当前位置：<span class="text-primary">添加商品分组</span>
</div>
<div class="page-content">
    <div class="page-sub-toolbar">
        <a class="btn btn-primary">添加商品分组</a>
    </div>
    <form action="" method="post" class="form-validate form-horizontal ">
        <div class="form-group">
            <label class="col-lg control-label must">排序</label>
            <div class="col-sm-9">
                {ife 'store.saler' $item}
                <input type="text" class="form-control valid" name="displayorder" value="{$item['displayorder']}"
                       data-rule-required="true"  />
                {else}
                <div class='form-control-static'>{$item['displayorder']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">头像</label>
            <div class="col-sm-9">
                {ife 'store.saler' $item}
                {php echo tpl_form_field_image2('thumb', $item['avatar'])}
                {else}
                <a href='{php echo tomedia($item['avatar'])}' target='_blank'>
                <img src="{php echo tomedia($item['avatar'])}" style='width:100px;border:1px solid #ccc;padding:1px' onerror="this.src='../addons/mx_shop/static/images/nopic.png'"/>
                </a>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label must">昵称</label>
            <div class="col-sm-4">
                {ife 'store.saler' $item}
                <input type="text" class="form-control valid" name="nickname" value="{$item['nickname']}"
                       data-rule-required="true" placeholder="请输入昵称" />
                {else}
                <div class='form-control-static'>{$item['nickname']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label must">姓名</label>
            <div class="col-sm-4">
                {ife 'store.saler' $item}
                <input type="text" class="form-control valid" name="realname" value="{$item['realname']}"
                       data-rule-required="true" placeholder="请输入姓名" />
                {else}
                <div class='form-control-static'>{$item['realname']}</div>
                {/if}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">所属门店</label>
            <div class="col-sm-9 col-xs-12">
                {ife 'store.saler' $item}
                    {php echo tpl_selector('storeid',array('text'=>'storename','preview'=>true,'type'=>'text',  'thumb'=>'','placeholder'=>'门店名称','buttontext'=>'选择门店 ', 'items'=>$store,'url'=>webUrl('store/query')))}
                {else}
                <div class='form-control-static'>{$item['storeid']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">职位</label>
            <div class="col-sm-9">
                {ife 'store.saler' $item}
                    {loop $types $key $row}
                        <label class="radio-inline"><input type="radio" name="type" value="{$key}" {if $item['type'] == $key} checked="checked"{/if}  />{$row}</label>
                    {/loop}
                {else}
                    {loop $types $key $row}
                        {if $item['type'] == $key} {$row}{/if}
                    {/loop}v>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">性别</label>
            <div class="col-sm-9">
                {ife 'store.saler' $item}
                    <label class="radio-inline"><input type="radio" name="sex" value="0" {if empty($item['sex'])} checked="checked"{/if}  />男</label>
                    <label class="radio-inline"><input type="radio" name="sex" value="1" {if $item['sex']==1} checked="checked"{/if} />女</label>
                {else}
                    {if empty($item['sex'])} 男{else}女{/if}
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label ">手机号</label>
            <div class="col-sm-4">
                {ife 'store.saler' $item}
                <input type="text" class="form-control valid" name="mobile" value="{$item['mobile']}"
                       data-rule-required="true" placeholder="请输入手机号" />
                {else}
                <div class='form-control-static'>{$store['mobile']}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">简介</label>
            <div class="col-sm-9">
                <textarea name="content" id="content" class="form-control" rows="5">{$item['content']}</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">工作时间</label>
            <div class="col-sm-9">

                {ife 'store.saler' $item}
                <div class="input-group" style="width: 400px;">
                    <span class="input-group-addon">开始时间</span>
                    <input type="text" name="btime" id="btime" class="form-control" value="{if empty($item['btime'])}08:00{else}{$item['btime']}{/if}" onclick="WdatePicker({dateFmt:'HH:mm'})"/>
                    <span class="input-group-addon">结束时间</span>
                    <input type="text" name="etime" id="etime" class="form-control" value="{if empty($item['etime'])}18:00{else}{$item['etime']}{/if}" onclick="WdatePicker({dateFmt:'HH:mm'})"/>
                </div>
                {else}
                <div class='form-control-static'>{if empty($item['btime'])}08:00{else}{$item['btime']}{/if}  至  {if empty($item['etime'])}18:00{else}{$item['etime']}{/if}</div>
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label">是否启用</label>
            <div class="col-sm-9">
                {ife 'store.saler' $item}
                <label class="radio-inline"><input type="radio" name="status" value="1" {if $item['status']==1} checked="checked"{/if} />是</label>
                    <label class="radio-inline"><input type="radio" name="status" value="0" {if empty($item['status'])} checked="checked"{/if}  />否</label>
                {else}
                    {if empty($item['sex'])} 禁用{else}启用{/if}
                {/if}
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9">
                {ife 'store.saler' $item}
                <input type="submit" class="btn btn-primary" value="保存">
                {/if}
                <a class="btn btn-default" href="{php echo webUrl('store/goodsgroup');}">返回列表</a>
            </div>
        </div>
    </form>
</div>
{template '_footer'}